﻿<div>
    名称：<input/>
    <br/>
    审批人：<select></select>
</div>
<script>
    angular.module('app')//非标优惠
.controller("Customer_EditC", function ($scope, $state, $http, $stateParams) {
    console.log($stateParams.id);
    $http.get("/api/Customer/Detail", { params: { "id": $stateParams.id } })
       .then(function (res) {
           $scope.data = res.data;
           console.log($scope.pageData);
       })
       .then(function (error) {
           if (error) {
               alert("数据获取失败");
           }
       });
    //获取地市
    $http({
        url: "/api/District",
        method: "GET"
    })
        .then(function (res) {
            $scope.districts = res.data;
        })
        .then(function (error) {
            if (error) {
                console.log("error");
            }
        });
    $scope.edit = function () {
        console.log($scope.data);
        $http.put("/api/Customer", $scope.data)
       .then(function (res) {
           alert("保存成功");
       }).then(function (error) {
           alert("处理失败");

       })
        ;
    }

})

</script>